(*
Own package for graphical Comands
*)
(*
Graphical Comand for ParametricPlot with color-variable;
based on the normal Parametricplot3D;
*)

Remove["Global`*"]


Options[ParametricPlotColor] = 
    Options[ParametricPlot];(*\[CapitalUDoubleDot]bernahme der normalen Plot -
     Options*)

Attributes[
      ParametricPlotColor] = {HoldAll};(*Variablen werden durch lokale \
Laufvariablen ersetzt*)

automatic[x_, value_] := If[x === Automatic, value, x];
(*Entscheidung f\[UDoubleDot]r Default - Options;
    " ===" erzwingt in jedem Fall eine Entscheidung;*)

Unprotect[ParametricPlot];

ParametricPlot[{x_, y_, c_}, {t_, t1_, t0_}, opt___] := Module[
    {curve = {x, y}, s, options, pltsty, pltopt, nonopt, dt, nt},
    options = List[opt, Sequence @@ Options[ParametricPlotColor]];
    (*Sequenziert die Liste der Optionen*)
    
    nt = automatic[PlotPoints /. options, 50]; 
    dt = (t1 - t0)/nt; 
    nonopt = {PlotPoints, PlotDivision, Compiled, MaxBend, PlotStyle};
	pltopt = Complement[ 
        options /. (
            
            nonopt /. a_Symbol -> ((a -> b_) -> a) /. ((List -> b_) -> List) ->
                 List), nonopt];
    
    Show[
      Graphics[
        Table[{c /. t -> s,
            Line[{curve /. t -> s, curve /. t -> (s + dt)}]},
          {s, t0, t1 - dt, dt}
          ]
        ], Sequence @@ pltopt
      ](*das eigentliche Plot - Comand*)
    ]
Protect[ParametricPlot];

(*
ParametricPlot[{Sin[t], Cos[t]},
    {t, 0, 8 Pi}];
*)
(*
ParametricPlot[{Sin[t], Cos[t], Hue[t]},
    {t, 0, 2 Pi}];
*)
